package html.field.inputs;

import html.field.Field;

public class Text implements Field {

	private StringBuffer style = new StringBuffer();
	private String name;

	@Override
	public Field css(String attr, String val) {
		if(style.toString().length()>0)
			style.append(";");
		style.append(attr+":"+val);
		return this;
	}
	
	public Text(String name)
	{
		this.name=name;
	}

	@Override
	public String out() {
		StringBuffer sb = new StringBuffer();
		sb.append("<input type=\"text\" name=\""+name+"\" style=\""+style+"\">");
		return sb.toString();
	}

}
